//const baseUrl = 'http://vr.com/vr'
const baseUrl = 'https://api.bailuyun.net/oem'
const baseUrl2 = 'https://api.bailuyun.net/pool'
//const version = '/v1'
const version = ''

function requestAction(options) {
	let { ...reqOptions } = options;
	
	let header = {
		/* "Authorization": userInfo.uid */
	}
	reqOptions.url = baseUrl + version + reqOptions.url;
	return new Promise((resolve, reject) => {
		let reqConfig = Object.assign({
			url: "",
			data: "",
			method: "POST",
			header: header,
			success: function(res) {
				resolve(res.data);
			},
			fail: function(res) {
				reject(res);
			}
		}, reqOptions);
		uni.request(reqConfig);
	})
}

function requestAction2(optionse) {
	let { ...reqOptions } = optionse;
	
	let header = {
		/* "Authorization": userInfo.uid */
	}
	reqOptions.url = baseUrl2 + version + reqOptions.url;
	return new Promise((resolve, reject) => {
		let reqConfig = Object.assign({
			url: "",
			data: "",
			method: "POST",
			header: header,
			success: function(res) {
				resolve(res.data);
			},
			fail: function(res) {
				reject(res);
			}
		}, reqOptions);
		uni.request(reqConfig);
	})
}
//获取openid
const getOpenid = params => {
    let options = {
        url: '/index/getOpenid',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取设备列表
const equipmentList= params => {
    let options = {
        url: '/equipment/equipmentList',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//发送验证码
const sendSms = params => {
    let options = {
        url: '/register/sendSms',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//提交验证码
const sendVc = params => {
    let options = {
        url: '/register/sendVc',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取用户信息
const getUserinfo = params => {
    let options = {
        url: '/index/getUserinfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}
//获取用户信息
const getInfo = params => {
    let options = {
        url: '/my/getInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getLog = params => {
    let options = {
        url: '/equipment_log/getLog',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getGoodsType = params => {
    let options = {
        url: '/goods/getGoodsType',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getGoods = params => {
    let options = {
        url: '/goods/getGoods',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


const getGoodsInfo = params => {
    let options = {
        url: '/goods/getGoodsInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取支付配置
const getPayConfig = params => {
    let options = {
        url: '/goods_pay/getPayConfig',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取
const getUserLog = params => {
    let options = {
        url: '/index/getUserLog',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取支付配置
const getUserLogInfo = params => {
    let options = {
        url: '/index/getUserLogInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取提现配置
const withDrawal = params => {
    let optionse = {
        url: '/goods_pay/withDrawal',
        data: params,
        notoken: true
    };
    return requestAction2(optionse)
}

const addBankCard = params => {
    let options = {
        url: '/my/addBankCard',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getBank = params => {
    let options = {
        url: '/my/getbank',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const withDrawalBank = params => {
    let options = {
        url: '/my/withDrawalBank',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getLine = params => {
    let options = {
        url: '/index/getLine',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getLineEqu = params => {
    let options = {
        url: '/equipment_log/getLineEqu',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getShare = params => {
    let options = {
        url: '/share/getShare',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const add = params => {
    let options = {
        url: '/equipment/add',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getText = params => {
    let options = {
        url: '/equipment/getText',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getAreaList = params => {
    let options = {
        url: '/index/getAreaList',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

const getRule = params => {
    let options = {
        url: '/index/getRule',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取盒子信息
const getBoxInfo = params => {
    let options = {
        url: '/yun_api/Jcdetails',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取盒子折线图信息
const getLineInfo = params => {
    let options = {
        url: '/yun_api/MinuteFlow',
        data: params,
        notoken: true
    };
    return requestAction(options)
}
//修改备注
const updateRemark = params => {
    let options = {
        url: '/yun_api/updateRemark',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//修改备注
const addEqu = params => {
    let options = {
        url: '/my/addEqu',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//添加分组
const addGroup = params => {
    let options = {
        url: '/Group/addGroup',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取分组
const getGroup = params => {
    let options = {
        url: '/Group/getGroup',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//删除分组
const delGroup = params => {
    let options = {
        url: '/Group/delGroup',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//移除分组
const removeGroup = params => {
    let options = {
        url: '/Group/removeGroup',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//移动分组
const moveGroup = params => {
    let options = {
        url: '/Group/moveGroup',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//修改分组
const updateGroup = params => {
    let options = {
        url: '/Group/updateGroup',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//团队信息
const getTeamInfo = params => {
    let options = {
        url: '/Team/getTeamInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//教程
const getNewsList = params => {
    let options = {
        url: '/News/getNewsList',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//教程详情
const getArticle = params => {
    let options = {
        url: '/News/getArticle',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//我的页面昨日收入
const getYesterday = params => {
    let options = {
        url: '/Index/getYesterday',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//我的页面分润收入
const getMyShare = params => {
    let options = {
        url: '/Index/getMyShare',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//修改昵称
const updateNickname = params => {
    let options = {
        url: '/my/updateNickname',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取近期提现记录
const getgorulelog = params => {
    let options = {
        url: '/my/getGoruleLog',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取全部提现记录
const getgorulealllog = params => {
    let options = {
        url: '/my/getGoruleAllLog',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取余额变更记录
const getBalanceLog = params => {
    let options = {
        url: '/my/getBalanceLog',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取订单
const getOrder = params => {
    let options = {
        url: '/order/getOrder',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//获取银行卡
const addBank = params => {
    let options = {
        url: '/my/addBankCard',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取图片
const getImg = params => {
    let options = {
        url: '/index/getImg',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取更多伙伴设备
const loadPage = params => {
    let options = {
        url: '/team/loadPage',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取激活卡
const receiveCard = params => {
    let options = {
        url: '/equipment/receiveCard',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//检测广告
const checkAdvertisement = params => {
    let options = {
        url: '/news/checkAdvertisement',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//流量曲线
const getQRCode = params => {
    let options = {
        url: '/index/getQRCode',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//首页设备排行
const rankList = params => {
    let options = {
        url: '/index/rankList',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//设备模糊搜索
const searchDevice = params => {
	let options = {
		url:'/equipment/searchDevice',
		data:params,
		notoken:true
	};
	return requestAction(options)
}


//添加服务器
const addServer = params => {
    let options = {
        url: '/niu_link/submit',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//添加大节点服务器
const addbigServer = params => {
    let options = {
        url: '/ppio_service/addDevice',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取网卡信息
const interfaces = params => {
    let options = {
        url: '/niu_link/interfaces',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取大节点网卡信息
const bgiinterfaces = params => {
    let options = {
        url: '/ppio_service/netCard',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//大节点获取网卡名称
const bignatname = params => {
    let options = {
        url: '/ppio_service/netCardManager',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//服务器拨号
const dialSubmit = params => {
    let options = {
        url: '/niu_link/dialSubmit',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//大节点服务器拨号
const bgidialSubmit = params => {
    let options = {
        url: '/ppio_service/netCard',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//服务器拨号
const getQualityReport = params => {
    let options = {
        url: '/niu_link/getQualityReport',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//服务器拨号
const dialStatus = params => {
    let options = {
        url: '/niu_link/dialStatus',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//宽带压测
const networkpressure = params => {
    let options = {
        url: '/niu_link/networkpressure',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//大节点服务器开始拨号
const bgipushnum = params => {
    let options = {
        url: '/ppio_service/start',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//大节点服务器拨号信息
const bgipushinfo = params => {
    let options = {
        url: '/ppio_service/dialingInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//获取大节点拨号返回信息
const bgicallinfos = params => {
    let options = {
        url: '/ppio_service/updateDialingInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//大节点服务器拨号
const bigdialStatus = params => {
    let options = {
        url: '/pool/ppio_service/dialingInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//流量曲线
const line = params => {
    let options = {
        url: '/niu_link/line',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//流量曲线
const rtRateLine = params => {
    let options = {
        url: '/niu_link/rtRateLine',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//流量曲线
const getNodeInfo = params => {
    let options = {
        url: '/niu_link/getNodeInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//流量曲线
const updateInfo = params => {
    let options = {
        url: '/niu_link/updateInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//流量曲线
const statuses = params => {
    let options = {
        url: '/niu_link/statuses',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//更换业务
const updateYewu = params => {
    let options = {
        url: '/equipment/updateYewu',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//云账户api添加银行卡
const addcloudbankcard = params => {
    let options = {
        url: '/cloud_account/VerifyBankcardForApi',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//云账户提现
// const getmoney = params => {
//     let options = {
//         url: '/cloud_account/OrderBankPay',
//         data: params,
//         notoken: true
//     };
//     return requestAction(options)
// }

// //云账户提现,审核(千智)
// const getmoney = params => {
//     let options = {
//         url: '/cloud_account/OrderBankPayNew',
//         data: params,
//         notoken: true
//     };
//     return requestAction(options)
// }
//云账户提现,不审核
const getmoney = params => {
    let options = {
        url: '/cloud_account/OrderBankPayNoCheck',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享质量报告接口
const getpaiquality = params => {
    let options = {
        url: '/ppio_service/deviceQuality',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享压测结果
const getbandwidth = params => {
    let options = {
        url: '/ppio_service/bandwidth',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享设备信息
const getdevice = params => {
    let options = {
        url: '/ppio_service/device',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//新派享质量报告
const getnewpaiquality = params => {
    let options = {
        url: '/ppio_service/getDeviceQuality',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享节点信息
const getpaijiedian = params => {
    let options = {
        url: '/ppio_service/nodeInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享网络信息
const getpainatinfo = params => {
    let options = {
        url: '/ppio_service/natInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享昨日质量报告接口
const getyesterdayInfo = params => {
    let options = {
        url: '/ppio_service/yesterdayInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享网络质量接口
const getnatNodeInfo = params => {
    let options = {
        url: '/ppio_service/natNodeInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//派享网络质量接口
const gethardwareInfo = params => {
    let options = {
        url: '/ppio_service/hardwareInfo',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取大节点多IP拨号
const bigipcall = params => {
    let options = {
        url: '/ppio_service/updateDialingInfoForIp',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取派享流量曲线接口
const pailine = params => {
    let options = {
        url: '/ppio_service/lineP',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//云账户中新云最新提现
const getbankmoney = params => {
    let options = {
        url: '/cloud_account/OrderBankPayNoCheck',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//云账户api签约接口
const getapiqianyue = params => {
    let options = {
        url: '/cloud_account/contract',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//更改设备ID
const updataremarkp = params => {
    let options = {
        url: '/yun_api/updateRemarkP',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//获取推荐任务
const toyewu = params => {
    let options = {
        url: '/ppio_service/task',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//删除银行卡
const delbank = params => {
    let options = {
        url: '/my/removeBank',
        data: params,
        notoken: true
    };
    return requestAction(options)
}
//新银行卡加云账户提现
const newPayouts = params => {
    let options = {
        url: '/goods_pay/platform',
        data: params,
        notoken: true
    };
    return requestAction(options)
}
//新提现签约
const createSignUser = params => {
    let options = {
        url: '/xinlong_pay/createSignUser',
        data: params,
        notoken: true
    };
    return requestAction(options)
}

//上传身份证
const uploadFile = params => {
    let options = {
        url: '/xinlong_pay/uploadFile',
        data: params,
        notoken: true
    };
    return requestAction(options)
}


//提现月金额
const checkMonthMoney = params => {
    let options = {
        url: '/goods_pay/checkMonthMoney',
        data: params,
        notoken: true
    };
    return requestAction(options)
}
export default {
	equipmentList,
	sendSms,
	sendVc,
	getUserinfo,
	getOpenid,
	getInfo,
	getLog,
	getGoodsType,
	getGoods,
	getGoodsInfo,
	getPayConfig,
	getUserLog,
	getUserLogInfo,
	withDrawal,
	addBankCard,
	getBank,
	withDrawalBank,
	getLine,
	getLineEqu,
	getShare,
	add,
	getText,
	getAreaList,
	getRule,
	getBoxInfo,
	getLineInfo,
	updateRemark,
	addEqu,
	addGroup,
	getGroup,
	delGroup,
	removeGroup,
	moveGroup,
	updateGroup,
	getTeamInfo,
	getNewsList,
	getArticle,
	getYesterday,
	getMyShare,
	updateNickname,
	getgorulelog,
	getgorulealllog,
	getBalanceLog,
	getOrder,
	addBank,
	getImg,
	loadPage,
	receiveCard,
	checkAdvertisement,
	getQRCode,
	rankList,
	searchDevice,
	
	addServer,
	addbigServer,
	interfaces,
	bgiinterfaces,
	bignatname,
	dialSubmit,
	bgidialSubmit,
	getQualityReport,
	dialStatus,
	networkpressure,
	line,
	rtRateLine,
	getNodeInfo,
	updateInfo,
	statuses,//n
	bgipushnum,
	bgipushinfo,
	bgicallinfos,
	bigdialStatus,//y
	updateYewu,
	addcloudbankcard,
	getmoney,
	getpaiquality,
	getbandwidth,
	getdevice,
	getnewpaiquality,
	getpaijiedian,
	getpainatinfo,
	getyesterdayInfo,//y
	getnatNodeInfo,
	gethardwareInfo,
	bigipcall,
	pailine,
	getbankmoney,
	getapiqianyue,
	updataremarkp,
	toyewu,
	
	delbank,
	newPayouts,
	createSignUser,
	uploadFile,
	checkMonthMoney
}